Fix refresh_update_time call with plugin name #2429
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that since upgrading to 4.5.X, AppDaemon generates way more traffic between itself and Home Assistant. It generates a continues stream of about 1 Mbps. It turns out that it keeps on getting full state updates every second once the initial
refresh_delayhas expired.The issue is that the
last_plugin_statedictionary is incorrectly updated with the entire plugin instead of just the plugin name. Because of this, the HASS plugin timestamp is never updated, causing it to remain expired and triggering a full state update every second. Providing the plugin name when refreshing the update time fixes the issue.I'm wondering why this hasn't come to the surface before because it looks like a critical issue to me.
Traffic generated before the fix (before 20:46:00):

Traffic generated after the fix (after 21:19:00, the single spike is because of a package update that's not related to AppDaemon):
